/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package daos;

import beans.Bean;

import beans.CartillaProfesionalesBean;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author Milene
 */
public class MSSQLCartillaProfesionalesDao extends MSSQLDao implements Dao{

    public MSSQLCartillaProfesionalesDao() throws Exception {
         super();
    }
    
    public MSSQLCartillaProfesionalesDao(String db) throws Exception {
        super(db);
    }

    
    @Override
    public Bean make(ResultSet result) throws Exception {
        
        CartillaProfesionalesBean cartillaPro = new CartillaProfesionalesBean();    
        cartillaPro.setNombreProfesional(result.getString("nombre"));
        cartillaPro.setApellidoProfesional(result.getString("apellido"));   
        cartillaPro.setNombreEspecialidad(result.getString("nombre_especialidad")); 
        cartillaPro.setNombrePrestadora(result.getString("nombre_prestadora")); 
       
        return cartillaPro;       
    }

    @Override
    public int insert(Bean bean) throws Exception {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public void update(Bean bean) throws Exception {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public void delete(Bean bean) throws Exception {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public List<Bean> select(Bean bean) throws Exception {
       
        ResultSet result;
        List<Bean> cartillaPro = new ArrayList<Bean>();
        this.setStatement("get_cartilla_profesionales"); // agregar el parametro al procedimiento
        result = this.getStatement().executeQuery();        
        
        
        while (result.next()) {

            cartillaPro.add(this.make(result));
        }

        return cartillaPro;
    }

    
    

       @Override
    public boolean valid(Bean bean) throws Exception {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public long getSize(Bean bean) throws Exception {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    
 
    public Bean get(Bean bean) throws Exception {
        throw new UnsupportedOperationException("Not supported yet.");
    }

   
    
}
